All Questions
24 questions
0votes
3answers
66views
Replace the trailing zero's of the date fields in the line
This is my input "004|B20A|2008-09-01 00:00:00.000|C|2008-09-01 00:00:00.070|4277" My output should be "004|B20A|2008-09-01 00:00:00.0|C|2008-09-01 00:00:00.07|4277"
0votes
2answers
2kviews
How to extract the key words containing row from an excel file?
I need to extract the key-words containing row from an excel file (.xls) as per the order specified in the given key-word file. For example I have an excel file namely genome.xls as given below, ...
0votes
2answers
98views
How to remove repetition of the content of file by column?
I have a file containing the following content: WP_021815421.1 OG5_132922 deth|YP_182312 3 -07 42.35 81.7 WP_021815427.1 OG5_128110 rbal|NP_868155 1 -55 50.72 53.2 WP_012456834.1 ...
0votes
5answers
810views
How can I change the character of a string one by one?
I want to change all the characters in string one by one according to the substitution rule and save them to file on Linux. This is substitution file (sub.txt). A -> Y B -> V C -> Q ... ...
1vote
2answers
97views
fastest way to subsitute on 10GB file for multiple expressions
I have a file of 10GB data, I want to execute 2048 substitution expressions of sed -i 's/pattern/replace_pattern/g' on that file. Is there a way to do it faster and effectively. Currently, I am ...
0votes
2answers
359views
how to print the matching value from same line, which has multiple Delimiter?
I have a File under Linux /tmp/volume.log and the content is: [id:1091666, name:root, deviceName:/dev/sda, maxStorage:107374182400, unitNumber:0, displayOrder:0, rootVolume:true],[id:1091851, name:/...
2votes
3answers
141views
how to remove syntax with uniq characters from line
we have the following configuration file, env.gc.txt export SERVER_GC_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:{{hbase_log_dir}}/gc.log-`date +'%Y%m%d%H%M'`" We try to ...
3votes
2answers
253views
How to add properties in the end of the two first lines with double quote?
We want to add the following properties: -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M in the two first lines that contain the word - HBASE_MASTER_OPTS Example before ...
-1votes
1answer
102views
How to delete from configuration file variable that not equal to 100
How to delete from configuration file the variable/s hadoop.tasklog.totalLogFileSize that are not equal to 100 example more file.conf hadoop.tasklog.totalLogFileSize=107 hadoop.tasklog....
4votes
1answer
3kviews
How to insert file content after a certain string in a file? [duplicate]
we have for example this file cat exam.txt I am expert linux man what we can do for out country I love redhat machine "propertie" centos less then redhat fedore what my name is moon yea we want to ...
0votes
2answers
900views
How to delete this string from a file using sed or perl?
I want to delete this string: no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"centos\" rather than the user \"root\".';echo;sleep 10" in below ...
2votes
2answers
157views
Capture the words in double quotes
How to capture the words in the double quote to one line as out.txt more input.txt "OQ -63/ECC/UK/JDA/adRedprairie" "OQ -63/ECC/UK/JDA/adRedprairie.ear" "OQ- 63/ECC/UK/JDA/adRedprairie.xml" "OQ/CZ/...
2votes
2answers
379views
Only keep lines containing x or less number of numbers. TXT file
I found a similar question: How to delete line if longer than XY? But in this case I want to check not the total length, but the number of digits in the line. For example, out of this input: ...
2votes
6answers
6kviews
How do I remove a words ending in the letter S if duplicates without an S on the end are on the same list?
I have a large list of words. Many of the words are only different because they have the letter s on the end. If a word on the list is the exact same as another word on the list, except one of the ...
0votes
1answer
1kviews
How do I calculate the column percentage of a file?
I have a tsv file that contains some values. I want the sum of each column and total number of values and percentage values. Eg: file.tsv contains x 1 1 0 1 x x 1 x ...